import { Typography } from "antd";
import { useState } from "react";
import "./index.scss"

export default function WordShow({ text }) {
  const [expanded, setExpanded] = useState(false);
  return (
    <Typography.Paragraph ellipsis={{
      rows: 2,
      expandable: 'collapsible',
      expanded,
      onExpand: (_, info) => setExpanded(info.expanded)
    }} style={{ width: 400, whiteSpace: 'normal' }}>
      {text?text:'-'}
    </Typography.Paragraph>
  )
}
